#include "cpu/exec/helper.h"
#include "test.h"
#include "cpu/decode/modrm.h"
make_helper(test_rm2r_w){
    op_src->size=op_dest->size=2;
    read_ModR_M(eip+1,op_dest,op_src);
    uint16_t result = op_dest->val & op_src->val;
    
	//OPERAND_W(op_dest, result);

        update_eflags_pf_zf_sf((int16_t)result);
        cpu.eflags.CF = cpu.eflags.OF = 0;
    cpu.eip+=2;
    return 0;
}
make_helper(test_rm2r_l){
    op_src->size=op_dest->size=4;
    read_ModR_M(eip+1,op_dest,op_src);
    Log("%u\n",cpu.eax);
    //Log("%u %u\n",op_dest->val,cpu.gpr[op_src->reg]._32);
    uint32_t result = op_dest->val & op_src->val;
    
	//OPERAND_W(op_dest, result);

        update_eflags_pf_zf_sf((int32_t)result);
        cpu.eflags.CF = cpu.eflags.OF = 0;
        cpu.eip+=2;
    //Log("%u %u\n",op_dest->val,cpu.eax);
    return 0;
}
make_helper_v(test_rm2r)